import { lazy } from 'react';
import { RouteObject, useRoutes } from 'react-router-dom';
const Home = lazy(() => import('@/views/Home'));
const GuidePage = lazy(() => import('@/views/GuidePage'));

// 创建一个可以被 React 应用程序使用的路由实例
const Router = () => {
  const constantRoutes: RouteObject[] = [
    {
      path: '/',
      id: 'Home',
      element: <Home />,
    },
    {
      path: '/guide-page',
      id: 'GuidePage',
      element: <GuidePage />,
    },
  ];


  const routes = useRoutes(constantRoutes);
  return routes;
};

export default Router;